<admintpl file="header" />
<style type="text/css">
    .pic-list li {
        margin-bottom: 5px;
    }
</style>
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a href="{:U('Contact/add',array('id'=>empty($item['id'])?'':$item['id']))}" target="_self">联系方式</a></li>
    </ul>
    <form action="{:U('Contact/add_post')}" method="post" class="form-horizontal js-ajax-forms" enctype="multipart/form-data" onsubmit="return checkform();">
        <div class="row-fluid">
            <div class="span9">
                <table class="table table-bordered">
                    <tr>
                        <th>联系电话 <span class="form-required">*</span></th>
                        <td>
                            <input type="text" name="mobile" class="require" id="mobile" value="{$item.mobile}" style="width: 400px" placeholder="请输入联系电话">
                        </td>
                    </tr>

                    <tr>
                        <th>电子邮箱 <span class="form-required">*</span></th>
                        <td>
                            <input type="text" name="email" class="require" id="email" value="{$item.email}" style="width: 400px" placeholder="请输入电子邮箱">
                        </td>
                    </tr>

                    <tr>
                        <th>地址 <span class="form-required">*</span></th>
                        <td>
                            <input type="text" name="address" class="require" id="address" value="{$item.address}" style="width: 400px" placeholder="请输入地址">
                        </td>
                    </tr>

                    <tr>
                        <th><b>官方微信 <span class="form-required">*</span></b></th>

                        <td>
                            <input type="hidden" class="require" name="qrcode" id="qrcode" value="{$item.qrcode}">
                            <div style="text-align: left;">

                                <a href="javascript:upload_one_image('图片上传','#qrcode');">
                                    <if condition="empty($item['qrcode'])">
                                        <img src="__TMPL__Public/assets/images/default-thumbnail.png" id="qrcode-preview" width="135" style="cursor: hand"/>
                                        <else />
                                        <img src="{:sp_get_image_preview_url($item['qrcode'])}" id="qrcode-preview" width="135" style="cursor: hand"/>
                                    </if>
                                </a>
                                <input type="button" class="btn btn-small" onclick="$('#qrcode-previeww').attr('src','__TMPL__Public/assets/images/default-thumbnail.png');$('#qrcode').val('');return false;" value="取消图片">
                            </div>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
        <div class="form-actions">
            <input type="hidden" name="id" value="{$item.id}"/>
            <button class="btn btn-primary js-ajax-submit" type="submit">提交</button>
            <a class="btn" href="{:U('Contact/index')}">返回</a>
        </div>
    </form>
</div>
<script type="text/javascript" src="__PUBLIC__/js/common.js"></script>
</body>
</html>